/**
 * Limit
 */
import React, {Component} from 'react';
import {connect} from 'dva';
var TimeLimit = require("./TimeLimit");
var PositionLimit = require("./PositionLimit");

class Limit extends Component {
    static defaultProps = {
        limits: {}
    };

    componentWillMount() {
        this.CONST = {
            KEYS: {
                TIME: "time_limit",
                POSITION: "position_limit"
            }
        }
    }

    render() {
        const {saveRecognizeProperty,updateState}=this.props;
        const limits = this.props.limits;
        const timeLimits = limits[this.CONST.KEYS.TIME];
        const positionLimits = limits[this.CONST.KEYS.POSITION];
        return (
            <div className="limit-content">
                <div className="header">
                    <div className="region">
                        <i></i>
                        <span>设置识别限制</span>
                    </div>
                </div>
                <div className="content">
                    <TimeLimit data={timeLimits} saveRecognizeProperty={saveRecognizeProperty} updateState={updateState}/>
                    <PositionLimit data={positionLimits} saveRecognizeProperty={saveRecognizeProperty} updateState={updateState}/>
                </div>
            </div>
        )
    }
}

export default Limit;
